layui.use('laydate', function() {

    var laydate = layui.laydate;

    laydate.render({
        elem: '#birthday'
    });

    $(function() {
        /*失去焦点时，判断用户名是否存在*/
        $("#account").blur(function () {
            var account = $("#account").val();
            $.ajax({
                url:"/user/selectAccountExists/" + account,
                type:"get",
                data:'',
                success:function (result) {
                    if (result.code == 500){
                        //用户存在
                        $(".exist_msg").html(result.msg);
                        $(".exist_msg").css("display","inline-block");
                        $("#account").focus();
                    }else {
                        $(".exist_msg").css("display","none");
                    }
                }
            })
        });
    });
});